<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
<head>
	<title>How To Manage Windows Service Application on our Local Computer - CodeProject</title> 
	<link type="text/css" rel="stylesheet" href="http://s.codeproject.com/App_Themes/Std/Css/CodeProject.min.css?dt=2.5.120528.1">

	
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Description" content="This article will demonstrate how we can manage Windows service application on our local computer.; Author: Md. &lt;b style=&quot;color: #FF9900&quot;&gt; M&lt;/b&gt;arufuzzaman; Updated: 4 Aug 2009; Section: C#; Chapter: Languages; Updated: 4 Aug 2009" />
<meta name="Keywords" content="VS2005, .NET3.0, .NET3.5, VS2008, C#, .NET, Visual-Studio, Beginner, Intermediate, .NET4,C#,Languages,Free source code, tutorials" />
<meta name="Author" content="Md. &lt;b style=&quot;color: #FF9900&quot;&gt; M&lt;/b&gt;arufuzzaman" />
<meta name="Rating" content="General" />
<meta name="Robots" content="index, follow, NOODP" />
<meta name="Revisit-After" content="1 days" />
<meta name="application-name" content="The Code Project" />

<meta name="msapplication-navbutton-color" content="#FF9900" />
<meta name="msapplication-tooltip" content="Your Development Resource." />
<meta name="msapplication-starturl" content="http://www.codeproject.com/?pinned=true" />
<meta name="msapplication-task" content="name=Homepage;action-uri=http://www.codeproject.com/;icon-uri=http://www.codeproject.com/favico.ico" />
<meta name="msapplication-task" content="name=Latest Articles;action-uri=http://www.codeproject.com/script/articles/Latest.aspx;icon-uri=http://www.codeproject.com/favico.ico" />
<meta name="msapplication-task" content="name=Questions and Answers;action-uri=http://www.codeproject.com/script/Answers/;icon-uri=http://www.codeproject.com/favico.ico" />
<meta name="msapplication-task" content="name=The Lounge;action-uri=http://www.codeproject.com/Lounge.aspx;icon-uri=http://www.codeproject.com/favico.ico" />

<link rel="dns-prefetch" href="//ajax.googleapis.com" /> 
<link rel="canonical" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L" />


<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - All Topics" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=1" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - MFC/C++" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=2" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - C#" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=3" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - VB.NET" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=6" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - Mobile" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=18" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - ASP.NET" href="http://www.codeproject.com/WebServices/ArticleRSS.aspx?cat=4" />
<link rel="alternate" type="application/rss+xml" title="CodeProject Lounge Postings" href="http://www.codeproject.com/webservices/LoungeRSS.aspx" />
<link rel="search" type="application/opensearchdescription+xml" title="CodeProject" href="http://www.codeproject.com/info/OpenSearch.xml" />

	<base target="_top" />
	<link rel="icon" href="/favicon.ico" type="image/ico" >
<link rel="shortcut icon" href="/favicon.ico"  type="image/ico" >
<link rel="apple-touch-icon" href="/images/FavIcon-Apple.png" type="image/png" >
<script type="text/javascript" language="Javascript">//<![CDATA[
if(top!=self && !/https?:\/\/([a-zA-Z]+\.)?facebook.com\//gi.test(top.location.href))top.location.href=location.href; if(typeof(DemoUrl)!='undefined')document.write(unescape('%3Cme')+'ta http'+'-equiv="re'+'fresh" con'+'tent="1;url='+DemoUrl+unescape('"%3CE'));
function SelfCheck(){ return window.confirm("You are about to reply to your own message. Is this really what you want?");}
function FireNew(elm) { window.location=$(elm).find('a')[0].href;}

function MsgVFrm(MemberID,MsgID,GB,gp,bp,mt){
 if(!GB)document.write("Rate this message: ");
 document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ","));document.write((GB?"5":"1")+unescape(",0);\"%3E"));
 if(GB) document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/good.png\" alt=\"good\" border=\"0\" align=\"absmiddle\" /%3E "+gp+" "+mt+"%3C/a%3E "));
 else document.write(unescape("%3Cimg height=\"14px\" width=\"14px\" src=\"http://s.codeproject.com/script/Forums/Images/thumbs_down.gif\" alt=\"vote 1\" border=\"0\" align=\"middle\" /%3E%3C/a%3E "));
 if(GB)document.write(" &nbsp;"); else for(var i=1; i<=5;i++)
  document.write(unescape("%3Ca class=\"toolbar nav-link\" href=\"#xx" + MsgID.toString() + "xx\" title=\"vote this message a " + i.toString() + "\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ", " + i.toString() + ",0)\"%3E%3Cb%3E" + i.toString() + "%3C/b%3E%3C/a%3E "));
 document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ","));document.write((GB?"1":"5")+unescape(",0);\"%3E"));
 if(GB)document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/bad.png\" alt=\"bad\" border=\"0\" align=\"absmiddle\" /%3E "+bp+" "+mt+"%3C/a%3E"));
 else document.write(unescape("%3Cimg height=\"14px\" width=\"14px\" src=\"http://s.codeproject.com/script/Forums/Images/thumbs_up.gif\" border=\"0\" alt=\"vote 5\" align=\"middle\" /%3E%3C/a%3E "));
}

function ReportMsg(userid, msgid, score) {
 if (confirm("Are you sure you want this message removed?"))
  return RateMsg(userid, msgid, score, 0);
 else return false;
}
function RateMsg(memberid, msgid, score, questionId) {
 var req = new XMLHttpRequest();
 req.onreadystatechange = function() {
  if (req.readyState == 4){
   if (req.status == 200){
    var respText = req.responseText;
    var re = new RegExp(unescape("\%3Cdiv\%3E(.*)\%3C/div\%3E"), "g");
    var match = re.exec(respText);
    voteStatus.innerHTML = unescape("%3Cb%3E") + (match&&match.length>1&&match[1])?match[1]:"An error occurred" + unescape("%3C/b%3E");
   } else
    voteStatus.innerHTML = unescape("%3Cb style='color:red'%3EFailed!") + req.statusText + unescape("%3C/b%3E");
  }
 }
 var voteStatus = document.getElementById("MVF" + msgid);
 if (!voteStatus) return;
 voteStatus.innerHTML = unescape("%3Cb style='color:green'%3EVoting...%3C/b%3E");
 var strAction = "/script/Forums/Vote.aspx?js=1&fmid="+memberid.toString()+"&select="+msgid.toString()+"&score="+score.toString()+"&qid="+questionId.toString();
 req.open("GET", strAction, true);
 req.send(null);
  return false;
}
var smoothScroll = true;
var Selected = "-1";
var oldTitle = document.title;
function Pin(elm){
 CloseMsg(Selected);
 Selected=''
 var wrk=elm.parentNode; if(wrk)wrk=wrk.children[0];
 var fc=elm?elm.firstChild:null;
 if (wrk&&!wrk.pinned) {
  OpenMsg(wrk.name, true);wrk.pinned=true;fc.src='http://s.codeproject.com/script/forums/images/pinned.gif';fc.title='Pinned. Click to unpin'
 } else {
  wrk.pinned=false;CloseMsg(wrk.name); fc.src='http://s.codeproject.com/script/forums/images/pin.gif';fc.title='Click to pin message'
 }
 return false;
}
function CloseMsg(msgId) {
 if(!msgId||msgId==''||msgId<0)return;
 var lnk=document.getElementsByName(msgId);
 if(lnk&&lnk.length>0&&lnk[0].pinned)return;
 var hed=document.getElementById('F' + msgId.toString() + '_h0');
 if(hed) hed.className = hed.className.replace("Sel", "UnSel");
 var bdy=document.getElementById('F' + msgId.toString() + '_h1');
 if(bdy) bdy.style.display = 'none';
 if(oldTitle) document.title = oldTitle;
}
function OpenMsg(msgId, keep) {
 if(!msgId||msgId==''||msgId<0)return;
 var bdy=document.getElementById('F' + msgId.toString() + '_h1');
 if(bdy){
  var lnk=document.getElementsByName(msgId);
  if(lnk&&lnk.length>0&&lnk[0].pinned)keep=true;
  if(lnk&&lnk.length>0) { oldTitle=document.title; document.title = lnk[0].innerHTML + ' - CodeProject'; }
  if(keep&&bdy.style.display!='none')return;
  if(bdy.style.display=='none') bdy.style.display='';
  else bdy.style.display = 'none';
 }
 var hed=document.getElementById('F' + msgId.toString() + '_h0');
 if (hed) hed.className = hed.className.replace('UnSel', 'Sel');
 if(bdy&&hed&&bdy.style.display!='none'){
  var webkitWeird=document.documentElement.scrollTop < document.body.scrollTop;
  if (!webkitWeird)document.body.scrollTop = getRealPos(hed, 'Top') - document.body.clientHeight/10;
  EnsureMessageVisible(msgId, true);
 }
}
function EnsureMessageVisible(msgID, bShowTop) {
	var webkitWeird = document.documentElement.scrollTop < document.body.scrollTop;
	var msgHeader = document.getElementById('F' + msgID + '_h0');
	var msgBody = document.getElementById('F' + msgID + '_h1');
	if (!msgBody || !msgHeader) return;
	var scrollContainer = document.documentElement;
	var top = getRealPos(msgHeader, 'Top');
	var bottom = getRealPos(msgBody, 'Top') + msgBody.offsetHeight;
	var scrollTop = webkitWeird? scrollTop = document.body.scrollTop:document.documentElement.scrollTop;
	if (scrollTop > top && !bShowTop) scrollTop = top - scrollContainer.clientHeight / 10;
	if (scrollTop + scrollContainer.clientHeight < bottom) scrollTop = bottom - scrollContainer.clientHeight;
	if (scrollTop > top && bShowTop) scrollTop = top - scrollContainer.clientHeight / 10;
 if (smoothScroll){
  if (webkitWeird) $(document.body).stop().animate({'scrollTop' : scrollTop}, 'fast');
  else $(scrollContainer).stop().animate({'scrollTop' : scrollTop}, 'fast');
 } else {
  if (webkitWeird) document.body.scrollTop = scrollTop;
  else scrollContainer.scrollTop = scrollTop;
 }
}
function getRealPos(i,which) {
	iPos = 0;
	while (i!=null)  {
		iPos += i['offset' + which];
		i = i.offsetParent;
	}
	return iPos;
}
var switchCallback;
function SwitchMessage(e, msgId) {
  if (msgId) msgId=msgId.toString();
  else {
    if(!e)e=window.event;
    var target=e.target?e.target:e.srcElement;
    while(target&&target.className!='message-link')target=target.parentNode;
    if(!target||target.className!='message-link')return;
    if(target.pinned){/*Selected='';*/return false;}
    msgId=target.name;
  }
  CloseMsg(Selected)
  if(Selected==msgId) Selected='';
  else { OpenMsg(msgId, false); Selected=msgId;}
  if (e){if(e.preventDefault)e.preventDefault;else e.returnValue=false;}
    if(switchCallback)switchCallback(null, msgId)
  return false;
}


//]]>
</script>

	
<script type="text/javascript">
  var _comscore = _comscore || [];
  _comscore.push({ c1: "2", c2: "13507173" });
  (function() {
	var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true;
	s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js";
	el.parentNode.insertBefore(s, el);
  })();
</script>
<noscript>
  <img src="http://b.scorecardresearch.com/p?c1=2&c2=13507173&cv=2.0&cj=1" id="ctl00_Auditing_ComScore" />
</noscript>



<script type="text/javascript">
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-1735123-1']);
	_gaq.push(['_trackPageview']);
	_gaq.push(['_setDomainName', 'www.codeproject.com']);
	_gaq.push(['_setSessionTimeout', '1200']); 

	(function () {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
	})(); 
</script>


</head>	

<body class="chrome chrome12">




<a href="#Main"><img alt="Click here to Skip to main content" class="access-link" src="/Images/t.gif" /></a>


<div class="page-background">
	<div id="A" class="container-content">

		
		<div id="ctl00_Suggest" class="suggestions">
		
<div class="alert-bar " style="display: none;">
	<a href="#" class="close-notify">×</a>
	<div><b>Not quite what you are looking for? You may want to try:</b><ul class="see-also"><li><a href="/KB/cs/ServiceController.aspx?q=ServiceControl">A ServiceController Class that Contains the Path to the Executable</a></li><li><a href="/KB/system/Svc_Controller_in_C_Sharp.aspx?q=ServiceControl">Using the ServiceController in C# to stop and start a service</a></li></ul><div id="removeHilite" class="alert-bar-command">
<a href="#" onclick="unmarkText('contentdiv','removeHilite')">highlights off</a>
</div>
</div>
</div>
		</div>

		

		
		

<div class="container nav-memberbar clearfix">
	<div class="member-stats float-left">8,874,771 members and growing! (52,948 online)</div>
	<div class="float-left"></div>

	<div class="float-right">
		&nbsp;&nbsp;
	</div>

	<div class="float-right">
		

<span class="tooltip member-message">
	<img src="/images/envelope11.gif" width="11px" height="11px" 
		style="vertical-align:bottom;padding-bottom:3px"/>
	<div class="tooltip-flyout small-text">
		
		<div id="ctl00_MemberMenu_Messages_Confirm"><a id="ctl00_MemberMenu_Messages_EmailConfirm" href="/script/Membership/SendConfirmRequest.aspx?rp=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L">Your email address needs to be confirmed.</a></div>
	</div>
</span><span id="ctl00_MemberMenu_CurRat" class="tooltip">
				<a id="ctl00_MemberMenu_MyProfile" href="/script/Membership/View.aspx?mid=8126139">quwenchao</a><img src="/Images/arrow-down-16.png" 
					style="width:16px;height:16px;vertical-align:bottom" />
				<div class="tooltip-flyout" style="width:110px !important">
					<div><a id="ctl00_MemberMenu_MySettingsNonSSL" href="http://www.codeproject.com/script/Membership/Modify.aspx">My Settings</a></div>
					<div><a id="ctl00_MemberMenu_MySettings" href="https://www.codeproject.com/script/Membership/Modify.aspx"><img src="/images/secure.png" width="13px" height="14px"  style="vertical-align:middle;border:0">My Settings (SSL)</a></div>
					<div><a id="ctl00_MemberMenu_MyContacts" href="/script/Membership/ListContacts.aspx">My Contact info</a></div>
					<div><a id="ctl00_MemberMenu_MyBookmarks" href="/script/Bookmarks/List.aspx?obtid=2">My Bookmarks</a></div>
					
					<div><a id="ctl00_MemberMenu_MyCodeProject" href="/script/Membership/MyWatchedItems.aspx">My Watched Items</a></div>
					<div><a id="ctl00_MemberMenu_MyArticles" href="/script/Articles/MemberArticles.aspx?amid=8126139">My Articles</a></div>
					<div><a id="ctl00_MemberMenu_MyMessages" href="/script/Forums/Messages.aspx?fmid=8126139">My Messages</a></div>
					<div><a id="ctl00_MemberMenu_MyQuestions" href="/script/Answers/MemberPosts.aspx?tab=questions&amp;mid=8126139&amp;showall=True">My Questions</a></div>
					<div><a id="ctl00_MemberMenu_MyAnswers" href="/script/Answers/MemberPosts.aspx?tab=answers&amp;mid=8126139&amp;showall=True">My Answers</a></div>
					<div><a id="ctl00_MemberMenu_MyComments" href="/script/comments/MemberComments.aspx?mid=8126139">My Comments</a></div>
					
				</div>
			</span><span id="ctl00_MemberMenu_TotalPoints" title="Total reputation points 965" class="member-rep-box silver" style="margin-left:0"><a href="/script/Reputation/List.aspx?mid=8126139">965</a></span>
			&nbsp;
			<a id="ctl00_MemberMenu_Signout" href="/script/Membership/LogOff.aspx?rp=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L">Sign out</a>

		
	</div>
</div>
		

		
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
			<td class="page-header"><a href="/"><img id="ctl00_Logo" title="The Code Project" src="http://s.codeproject.com/App_Themes/Std/Img/logo225x90.gif" alt="Home" style="border-width:0px;" /></a></td>
			<td class="page-header" align="right">
				<div class="lqm_ad" lqm_publisher="lqm.codeproject.site"  lqm_zone="ros" lqm_format="728x90" lqm_tags='VS2005, .NET3.0, .NET3.5, VS2008, C#, .NET, Visual-Studio, Beginner, Intermediate, .NET4,rating4.5'></div>
			</td>
		</tr></table>

		<table cellpadding="0" cellspacing="0" class="contrast1-background extended"><tr><td nowrap="nowrap">
			

<div class="navbar clearfix">
<ul id="nav" class="openable">

<li><a id="ctl00_TopNavBar_Home" class="down" href="http://www.codeproject.com">Home</a>


<li><a id="ctl00_TopNavBar_Art" class="down selected" href="/script/Articles/Latest.aspx">Articles</a>

	<ul class="openable">
		<li><a id="ctl00_TopNavBar_ArtTopicList" class="fly last" onmouseover="navBarMenu.ShowMap(this, &#39;siteMap&#39;);" href="/script/Content/SiteMap.aspx">Chapters and Sections<span class="fly-menu">&gt;</span></a><ul id="ctl00_TopNavBar_MapFlyout" class="openable"><li>
				<div id="siteMap" class="tooltip-flyout">
					<img src="/images/animated.gif" style="margin:150px;width:100px;height:100px;" />
				</div>
			</li></ul>
		</li>
		<li><a id="ctl00_TopNavBar_ArtSearch" class="fly break" href="/search.aspx">Search</a></li>
		<li><a id="ctl00_TopNavBar_ArtLatestArts" class="fly" href="/script/Articles/Latest.aspx?at=1,3,7">Latest Articles</a></li>
		<li><a id="ctl00_TopNavBar_ArtLatestTips" class="fly" href="/script/Articles/Latest.aspx?at=6">Latest Tips/Tricks</a></li>
		<li><a id="ctl00_TopNavBar_ArtTop" class="fly" href="/script/Articles/TopArticles.aspx?ta_so=5">Top Articles</a></li>
		<li><a id="ctl00_TopNavBar_ArtBeginner" class="fly" href="/search.aspx?aidlst=152&amp;sa_us=True">Beginner Articles</a></li>
		<li id="ctl00_TopNavBar_VideosLink">
			<a id="ctl00_TopNavBar_ArtVideoArticles" class="fly" href="/script/Articles/VideoArticleList.aspx">Video Articles</a>
		</li>
		<li><a id="ctl00_TopNavBar_ArtBlogArticles" class="fly break" href="/script/Articles/BlogArticleList.aspx">Technical Blogs</a></li>
		<li><a id="ctl00_TopNavBar_ArtPostArticle" class="fly" href="/script/Articles/Submit.aspx">Submit an Article or Tip</a></li>
		<li><a id="ctl00_TopNavBar_ArtPostBlog" class="fly break" href="/script/Articles/BlogFeed.aspx">Post your Blog</a></li>
		<li><a id="ctl00_TopNavBar_ArtGuide" class="fly" href="/info/Submit.aspx">Posting/Update Guidelines</a></li>
		<li><a id="ctl00_TopNavBar_ArtCompetition" class="fly last" href="/script/Awards/CurrentCompetitions.aspx?cmpTpId=1">Article Competition</a></li>
	</ul>

</li>



<li><a id="ctl00_TopNavBar_Answers" href="/script/Answers/List.aspx?tab=active">Quick Answers</a>
	<ul class="openable">
		<li id="ctl00_TopNavBar_AQL"><a id="ctl00_TopNavBar_ArticleQuestion" class="fly highlight" href="#_comments">Ask a Question about this article</a></li>

		<li><a id="ctl00_TopNavBar_QAAsk" class="fly" href="/Questions/ask.aspx">Ask a Question</a></li>

		
		<li><a id="ctl00_TopNavBar_QAUnanswered" class="fly" href="/script/Answers/List.aspx?tab=unanswered">View Unanswered Questions</a></li>
		<li><a id="ctl00_TopNavBar_QALatest" class="fly" href="/script/Answers/List.aspx?tab=active">View All Questions...</a></li>
		
				<li><a id="ctl00_TopNavBar_QATR_ctl00_Tag" class="fly" href="/script/Answers/List.aspx?tab=active&amp;alltags=true&amp;tags=81" style="padding-left:30px">C# questions</a></li>
			
				<li><a id="ctl00_TopNavBar_QATR_ctl01_Tag" class="fly" href="/script/Answers/List.aspx?tab=active&amp;alltags=true&amp;tags=85" style="padding-left:30px">ASP.NET questions</a></li>
			
				<li><a id="ctl00_TopNavBar_QATR_ctl02_Tag" class="fly" href="/script/Answers/List.aspx?tab=active&amp;alltags=true&amp;tags=842" style="padding-left:30px">VB.NET questions</a></li>
			
				<li><a id="ctl00_TopNavBar_QATR_ctl03_Tag" class="fly" href="/script/Answers/List.aspx?tab=active&amp;alltags=true&amp;tags=78" style="padding-left:30px">C++ questions</a></li>
			
				<li><a id="ctl00_TopNavBar_QATR_ctl04_Tag" class="fly" href="/script/Answers/List.aspx?tab=active&amp;alltags=true&amp;tags=308" style="padding-left:30px">C#4.0 questions</a></li>
			
	</ul>

</li>



<li><a id="ctl00_TopNavBar_Forums" href="/script/Forums/List.aspx">Discussions</a>

	<ul class="openable">
		<li><a id="ctl00_TopNavBar_MessageBoardsAll" class="fly" href="/script/Forums/List.aspx">All Message Boards...</a></li>
		<li><a class="fly" style="padding-left:30px" href="/Forums/1580997/Application-Lifecycle.aspx">Application Lifecycle<span class="fly-menu">&gt;</span></a>
<ul class="openable"><li><a class="fly" href="/Forums/1533717/Running-a-Business.aspx">Running a Business</a></li>
<li><a class="fly" href="/Forums/1533716/Sales-Marketing.aspx">Sales / Marketing</a></li>
<li><a class="fly" href="/Forums/1651/Collaboration-Beta-Testing.aspx">Collaboration / Beta Testing</a></li>
<li><a class="fly" href="/Forums/3304/Work-Training-Issues.aspx">Work &amp; Training Issues</a></li>
</ul></li>
<li><a class="fly" style="padding-left:30px" href="/Forums/369270/Design-and-Architecture.aspx">Design and Architecture</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/12076/ASP-NET.aspx">ASP.NET</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1580226/JavaScript.aspx">JavaScript</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1647/C-Cplusplus-MFC.aspx">C / C++ / MFC<span class="fly-menu">&gt;</span></a>
<ul class="openable"><li><a class="fly" href="/Forums/4486/ATL-WTL-STL.aspx">ATL /  WTL / STL</a></li>
<li><a class="fly" href="/Forums/3785/Managed-Cplusplus-CLI.aspx">Managed C++/CLI</a></li>
</ul></li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1649/Csharp.aspx">C#</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1627782/Free-Tools.aspx">Free Tools</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1725/Database.aspx">Database</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/186301/Hardware-Devices.aspx">Hardware &amp; Devices<span class="fly-menu">&gt;</span></a>
<ul class="openable"><li><a class="fly" href="/Forums/1644/System-Admin.aspx">System Admin</a></li>
</ul></li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1606152/Hosting-and-Servers.aspx">Hosting and Servers</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1643/Java.aspx">Java</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1650/NET-Framework.aspx">.NET Framework</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/13695/Mobile.aspx">Mobile</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1653293/VS-11-NET-4-5.aspx">VS 11 &amp; .NET 4.5</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1540733/Sharepoint.aspx">Sharepoint</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1004257/Silverlight-WPF.aspx">Silverlight / WPF</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1646/Visual-Basic.aspx">Visual Basic</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1640/Web-Development.aspx">Web Development</a>
</li>
<li><a class="fly" style="padding-left:30px" href="/Forums/1645/Site-Bugs-Suggestions.aspx">Site Bugs / Suggestions</a>
</li>

		<li class="heading">Other Languages<span class="fly-menu">&gt;</span>
		<ul class="openable">
		<li><a class="fly" href="/Forums/1580229/Hindi.aspx">General Indian Topics</a></li>
		<li><a class="fly" href="/Forums/1580230/Chinese.aspx">General Chinese Topics</a></li>
		</ul>
		</li>
		
	</ul>

</li>

<li><a id="ctl00_TopNavBar_Zones" href="/Zones/index.aspx">Zones</a>

	<ul class="openable">
		<!--<li class="heading">Zones</li>-->
		<li><a href="/Zones/Commerce/" class="fly">The Commerce Zone</a></li><li><a href="/Zones/Mobile/" class="fly">The Mobile & App Zone</a></li><li><a href="/Zones/Cloud/" class="fly">The Cloud Zone</a></li><li><a href="/Zones/Hardware/" class="fly">The Hardware Zone</a></li><li><a href="/Zones/Parallelism/" class="fly">The Parallelism Zone</a></li><li><a href="/Zones/WPF-Silverlight/" class="fly">The WPF / Silverlight Zone</a></li><li><a href="/Zones/Flex-Flash/" class="fly">The Flex / Flash Zone</a></li><li><a href="/Zones/HTML-CSS/" class="fly">The HTML5 / CSS3 Zone</a></li><li><a href="/Zones/SharePoint/" class="fly">SharePoint Zone</a></li><li><a href="/Zones/SqlServer/" class="fly">The SQL Zone</a></li><li><a href="/Zones/WhitePapers/" class="fly break">WhitePapers / Webcasts</a></li>
		<li><a id="ctl00_TopNavBar_Solutions" class="fly last" href="/KB/solution-center/">Solutions Center</a></li>
	</ul>

</li>










<li><a id="ctl00_TopNavBar_Features" href="/Feature/">Features</a>

	<ul class="openable">
		<li><a id="ctl00_TopNavBar_WhosWho" class="fly" href="/script/Membership/Profiles.aspx">Who's Who</a></li>
		<li><a id="ctl00_TopNavBar_MVPs" class="fly" href="/script/Awards/MVPWinners.aspx">Most Valuable Professionals</a></li>
		<li><a id="ctl00_TopNavBar_Companies" class="fly break" href="/script/Membership/Profiles.aspx?mgtid=1&amp;mgm=True">Company Listings</a></li>
		<li><a id="ctl00_TopNavBar_Catalog" class="fly" href="/script/Catalog/List.aspx">Component & Service Catalog</a></li>
		<li><a id="ctl00_TopNavBar_Comps" class="fly" href="/script/Awards/CurrentCompetitions.aspx?cmpTpId=1&amp;awsac=true">Competitions</a></li>
		<li><a id="ctl00_TopNavBar_News" class="fly" href="/script/News/List.aspx">News</a></li>
		<li></li>
		<li><a id="ctl00_TopNavBar_Insider" class="fly" href="/Feature/Insider/">The Insider Newsletter</a></li>
		<li><a id="ctl00_TopNavBar_Newsletters" class="fly" href="/script/Mailouts/Archive.aspx?mtpid=1">Newsletter archive</a></li>
		<li><a id="ctl00_TopNavBar_PressRelease" class="fly" href="/script/PressReleases/Preview.aspx">Press Releases</a></li>
		<li><a id="ctl00_TopNavBar_Surveys" class="fly" href="/script/Surveys/List.aspx">Surveys</a></li>
		<li><a id="ctl00_TopNavBar_Stuff" class="fly last" href="/Info/Stuff.aspx">CodeProject Stuff</a></li>
		<li></li>
	</ul>

</li>


<li><a id="ctl00_TopNavBar_Help" href="/KB/FAQs/">Help!</a>

	<ul class="openable">
		<li><a id="ctl00_TopNavBar_HelpWhatIs" class="fly" href="/info/guide.aspx">What is 'The Code Project'?</a></li>
		<li><a id="ctl00_TopNavBar_HelpGeneral" class="fly" href="/KB/FAQs/">General FAQ</a></li>
		<li><a id="ctl00_TopNavBar_HelpPostQuestion" class="fly" href="/Questions/ask.aspx">Post a Question</a></li>
		<li><a id="ctl00_TopNavBar_HelpBugs" class="fly" href="/Forums/1645/Site-Bugs-Suggestions.aspx">Bugs and Suggestions</a></li>
		<li><a id="ctl00_TopNavBar_HelpSiteMap" class="fly" href="/script/Content/SiteMap.aspx">Site Map</a></li>
		<li><a id="ctl00_TopNavBar_HelpAdvertise" class="fly" href="http://lakequincy.com/">Advertise with us</a></li>
		<li><a id="ctl00_TopNavBar_HelpAboutUs" class="fly last" href="/info/about.aspx">About Us</a></li>
	</ul>

</li>


<li style="margin-left:10px">
<a id="ctl00_TopNavBar_Lounge" class="simple" href="/Lounge.aspx">The Lounge</a>

	<ul class="openable">
		<li><a id="ctl00_TopNavBar_InsiderLnk" class="fly" href="/Insider.aspx">The Insider News</a></li>
		<li><a id="ctl00_TopNavBar_LoungeLnk" class="fly" href="/Lounge.aspx">The Lounge  </a></li>
		<li><a id="ctl00_TopNavBar_CleverLnk" class="fly" href="/Feature/CleverCode.aspx">Clever Code</a></li>
		<li><a id="ctl00_TopNavBar_ShameLnk" class="fly" href="/Feature/HallOfShame.aspx">Hall of Shame</a></li>
		<li><a id="ctl00_TopNavBar_SoapBoxLnk" class="fly" href="/Forums/1536756/The-Soapbox.aspx">The Soapbox</a></li>
	</ul>

</li>

</ul>

</div>

		</td><td align="right">
			

<div class="search-bar">

<form method="get" action="/search.aspx" name="Search" class="tight">


<table border="0" cellspacing="0" cellpadding="0" class="search"><tr><td><input TabIndex="2" class="search highlight" id="sb_tb" value="ServiceControl" name="q" /></td><td><input type="image" src="/images/search.gif" /></td></tr></table>

<div class="hover-container">
	<div id="SearchFilter" class="search-advanced popup small-text align-left">
	<b>Search within:<br /></b>
		
		<input type="radio" id="sb_kw" name="sbo" value="kw" checked="true"><label for="sb_kw">Articles</label><br>
<input type="radio" id="sb_qa" name="sbo" value="qa"><label for="sb_qa">Quick Answers</label><br>
<input type="radio" id="sb_fm" name="sbo" value="fm"><label for="sb_fm">Messages</label><br>
<input type="radio" id="sb_ctlk" name="sbo" value="ctlk"><label for="sb_ctlk">Product Catalog</label><br>


		
		
	</div>
</div>
</form>

</div>
		</td></tr></table>
		

		
		<div class="container-article hreview-aggregate"> 
		
			
			<div class="container-header">
				<div id="ctl00_Header" class="header">

					<a name="Main"></a>

					
					<a name="_articleTop" id="_articleTop"></a>
					

<div class="clearfix hover-container">

	
	<div class="float-right action-links"> 
		<span id="SBI"><img src="http://s.codeproject.com/images/share_drop24.png" id="ctl00_TitleArea_ActionLinks_AddTo_Img" width="37" height="24" alt="add" style="vertical-align:middle" />
</span>
<div id="ATD" class="list-socialbookmark"></div> 
 

<span class="tooltip">
	<a id="ctl00_TitleArea_ActionLinks_ArticleBmk_ImgBt" title="Bookmark" AlternateText="Bookmark" name="bm_38746_2" onclick="return bookmarkMe(38746,2,&#39;/script/Bookmarks/Ajax/Add.aspx?obid=38746&amp;obtid=2&amp;action=AddBookmark&amp;bio=true&#39;,true);" href="/script/Bookmarks/Add.aspx?obid=38746&amp;obtid=2&amp;action=AddBookmark&amp;bio=true" style="display:inline-block;height:24px;width:24px;vertical-align:middle;"><img title="Bookmark" src="http://s.codeproject.com/script/Bookmarks/Images/bookmark.png" alt="" style="border-width:0px;" /></a>


<span id="ctl00_TitleArea_ActionLinks_ArticleBmk_StatusMsg" class="tiny-text" style="display:none" name="bm_38746_2"></span>
 
	<div class="speech-bubble-container-up">
		<div class="speech-bubble-up">Add to your CodeProject bookmarks</div>
		<div class="speech-bubble-pointer-up">
			<div class="speech-bubble-pointer-up-inner"></div>
		</div>
	</div>
</span>


<a id="ctl00_TitleArea_ActionLinks_PrintLnk" class="tooltip" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?display=Print">
	<img src="http://s.codeproject.com/script/Content/Images/print.gif" 
		width="24px" height="24px" style="vertical-align:middle;border:0">
	<div class="speech-bubble-container-up">
		<div class="speech-bubble-up">Print Article</div>
		<div class="speech-bubble-pointer-up">
			<div class="speech-bubble-pointer-up-inner"></div>
		</div>
	</div>
</a>
	</div>

	<div class="container">
		
		<div class="breadcrumb float-left"><a href="/script/Content/SiteMap.aspx"><span class="sitemap-anchor" onmouseover="navBarMenu.ShowMap(this,'map');"><img width="16px" height="16px" src="/images/sitemap16.png" border="0" alt="Site map" style="vertical-align:middle" /><div id="map" class="tooltip-flyout"><img src="/images/animated.gif" style="margin:150px;width:100px;height:100px;border:0;" /></div></span></a> &#187; <a href="/Chapters/5/Languages.aspx">Languages</a> &#187; <a href="/KB/cs/">C#</a> &#187; <a href="/KB/cs/#How+To">How To</a></div>
	</div>

	
	<div id="ctl00_TitleArea_InfoArea" class="float-right pad-top">
		

<div class="infobox">
	<table class="tight small-text" cellpadding="0" cellspacing="1">
	<tr><td>Licence&nbsp;</td><td><a href="http://www.codeproject.com/info/cpol10.aspx" title="The Code Project Open License (CPOL)">CPOL</a></td></tr>
	
	<tr><td>First Posted&nbsp;</td><td nowrap="nowrap"><b>4 Aug 2009</b></td></tr>
	<tr><td>Views&nbsp;</td><td><b>11,247</b></td></tr>
	
	<tr><td>Downloads&nbsp;</td><td><b>604</b></td></tr>
		
	
	<tr><td>Bookmarked&nbsp;</td><td><b>59 times</b></td></tr>
	

	
	
	</table>
</div>	
	</div>

	
	<div class="item">
	<h1 id="ctl00_TitleArea_ArticleTitle" class="fn">How To Manage Windows Service Application on our Local Computer</h1> 
	</div>

	
	<div class="author">
		By <b><a rel="author" href="/script/Membership/View.aspx?mid=1186309">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></b> | 
		4 Aug 2009 
		
		| <a id="ctl00_TitleArea_ArticleInfoLink" href="/script/Articles/Types.aspx?#Article">Article</a>

		
		
	</div>
	
	<div class="tags">
	<span id="ctl00_TitleArea_TagsList_TagWrp" class="tags">
	
	
	
	<span id="ctl00_TitleArea_TagsList_VisibleTags"><span class="t"><a rel="tag" href="/Tags/VS2005">VS2005</a></span><span class="t"><a rel="tag" href="/Tags/.NET3.0">.NET3.0</a></span><span class="t"><a rel="tag" href="/Tags/.NET3.5">.NET3.5</a></span><span class="t"><a rel="tag" href="/Tags/VS2008">VS2008</a></span><span class="t"><a rel="tag" href="/Tags/C%23">C#</a></span><span class="t"><a rel="tag" href="/Tags/.NET">.NET</a></span><span class="t"><a rel="tag" href="/Tags/Visual-Studio">Visual-Studio</a></span><span class="t"><a rel="tag" href="/Tags/Beginner">Beginner</a></span><span class="t"><a rel="tag" href="/Tags/Intermediate">Intermediate</a></span><span class="t"><a rel="tag" href="/Tags/.NET4">.NET4</a></span></span> 

	
	
</span>

	</div>

	
	<div class="abstract summary"><span id="ctl00_TitleArea_ArticleDescr">This article will demonstrate how we can manage Windows service application on our local computer.</span></div>
</div>



					

				</div>

				<div id="ctl00_HeadSide" class="header-sidebar">
					<div class="align-left" style="height:24px">
						


&nbsp;










					</div>

					

<div class="bold pad-top">See Also</div>
<ul class="outdent small-text" style="margin-left:5px">
	<li><a id="ctl00_SeeAlso_LikeThis" href="/search.aspx?q=How++Manage+Windows+Service+Application+on+our+Local+Computer">More like this</a></li>
	<li><a id="ctl00_SeeAlso_ByAuthor" href="/script/Articles/MemberArticles.aspx?amid=1186309">More by this author</a></li>
</ul>

				</div>

			</div>
			

			
			<div id="ctl00_Nav" class="container-nav">
				<div id="ctl00_TabContainer" class="tabs-container clearfix">

					<div class="float-left">
						
						

<div class="tabs float-left"><table cellpadding="0" cellspacing="0"><tr>
	<td class="tab-selected">Article</td><td class="tab-unselected"><a href="/script/Articles/ViewDownloads.aspx?aid=38746">Browse Code</a></td><td class="tab-unselected"><a href="/script/Articles/Statistics.aspx?aid=38746">Stats</a></td><td class="tab-unselected"><a href="/script/Articles/ListVersions.aspx?aid=38746">Revisions (4)</a></td><td class="tab-unselected"><a href="/script/Articles/ListAlternatives.aspx?aid=38746">Alternatives</a></td>
</tr></table></div>	


						
						<div class="float-left" style="margin-left:15px">
							<div id="ctl00_CurRat" class="tooltip anchorLink" style="cursor:pointer" onclick="scrollToAnchor(&#39;#_rating&#39;);" name="CurRat_38746">
								

<table cellpadding="0" cellspacing="0" class="small-text">
<tr>
	
	<td class="nowrap">

		<span id="ctl00_ArticleRating_VI">
		<div class="nowrap rating-stars" style="height:24px;width:120px;position:relative;">
	<div class="clipped align-left float-left" style="height:24px;width:120px;">
		<img src="http://s.codeproject.com/script/Ratings/Images/stars-fill.png" style="border-width:0px;" />
	</div><div class="clipped" style="height:24px;width:0px;position:relative;">
		<img src="http://s.codeproject.com/script/Ratings/Images/stars-empty.png" style="border-width:0px;position:absolute;top:0;right:0;" />
	</div>
</div>
		</span>

		
	</td>
	
	<td id="ctl00_ArticleRating_VR" class="nowrap">
		&nbsp;
		<span id="ctl00_ArticleRating_VotesR">&nbsp;<span class="rating">5.00</span> (<span class="count">21 votes</span>)</span>
		
	</td>

</tr>

</table>

								<div id="ctl00_RB" class="speech-bubble-container-up">
									<div class="speech-bubble-up" style="width:150px !important">
										            
<div>
<table class="feature" width="100%" height="50px" title="Voting Distribution. Recent data only" cellpadding="0" cellspacing="0"><tr><td class="chart-column rating-ignore-vote" title="Outside deviation limits - not included in score."><img src="http://s.codeproject.com/Images/t.gif" width="20pxpx" height="1px" border="0px" alt="" title="" /><br /><span title="0 votes">1</span></td>
<td class="chart-column rating-ignore-vote" title="Outside deviation limits - not included in score."><img src="http://s.codeproject.com/Images/t.gif" width="20pxpx" height="1px" border="0px" alt="" title="" /><br /><span title="0 votes">2</span></td>
<td class="chart-column rating-ignore-vote" title="Outside deviation limits - not included in score."><img src="/script/Ratings/Images/pollcol.gif" width="20pxpx" height="5px" border="0px" alt="2 votes, 9.5%" title="2 votes, 9.5%" /><br /><span title="2 votes">3</span></td>
<td class="chart-column"><img src="http://s.codeproject.com/Images/t.gif" width="20pxpx" height="1px" border="0px" alt="" title="" /><br /><span title="0 votes">4</span></td>
<td class="chart-column"><img src="/script/Ratings/Images/pollcol.gif" width="20pxpx" height="50px" border="0px" alt="19 votes, 90.5%" title="19 votes, 90.5%" /><br /><span title="19 votes">5</span></td>
</tr></table><div class="small-text align-center">5.00/5 - 21 votes</div><div class="small-text align-center subdue">2 removed</div><div class="small-text align-center subdue">μ 4.80, σ<sub>a</sub> 1.05 [<a href="/KB/FAQs/RatingReputationFAQ.aspx#noisefilter">?</a>]</div>
</div>
									</div>
									<div class="speech-bubble-pointer-up">
										<div class="speech-bubble-pointer-up-inner"></div>
									</div>
								</div>
							</div>
						</div>

						<div class="float-left">
							&nbsp; 
							<a id="discussAnch" href="#_comments" class="tooltip anchorLink">
							<img src="http://s.codeproject.com/script/Content/Images/discuss.gif" 
								width="24px" height="24px" alt="Discuss" style="vertical-align:middle;border:0" />
								<div class="speech-bubble-container-up">
									<div class="speech-bubble-up">Discuss this article</div>
									<div class="speech-bubble-pointer-up">
										<div class="speech-bubble-pointer-up-inner"></div>
									</div>
								</div>
							</a>
							<span id="ctl00_CmtCnt" class="subdue small-text align-middle" style="margin-left:-4px">8</span>

							&nbsp; <span id="ctl00_ReportItem_StatusMsg" class="tiny-text" style="display:none"></span>


<span id="ctl00_ReportItem_CurRpt" class="tooltip">	
		<img id="ctl00_ReportItem_MenuImage" alt="report" src="http://s.codeproject.com/script/Content/Images/report.gif" style="border-width:0px;vertical-align:middle" />
		
		<div class="tooltip-flyout" style="width:220px !important" onmouseover="CheckForUndo(this);">
			<div id="ctl00_ReportItem_CommentDiv" class="small-text">
			<b>Comments?</b><br />
				<input name="ctl00$ReportItem$Comments" type="text" id="ctl00_ReportItem_Comments" class="report-comment" />
			</div>
			 
			
					<div id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_Header" class="report-header">Report</div>
					
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl00_Link" name="rpt_38746_2_1" onclick="return ReportMe(38746,2,1,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=1&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=1">Unclear or Incomplete</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl01_Link" name="rpt_38746_2_10" onclick="return ReportMe(38746,2,10,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=10&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=10">Extremely poor quality</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl02_Link" name="rpt_38746_2_4" onclick="return ReportMe(38746,2,4,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=4&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=4">Off-topic</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl03_Link" name="rpt_38746_2_5" onclick="return ReportMe(38746,2,5,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=5&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=5">Spam/abusive</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl04_Link" name="rpt_38746_2_11" onclick="return ReportMe(38746,2,11,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=11&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=11">Plagiarized</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl00_ReportingTypes_ctl05_Link" name="rpt_38746_2_12" onclick="return ReportMe(38746,2,12,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=12&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=12">Inaccurate / Misleading</a>
							</div>
						 
			   
					<div id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_Header" class="report-header">Needs help</div>
					
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_ReportingTypes_ctl00_Link" name="rpt_38746_2_14" onclick="return ReportMe(38746,2,14,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=14&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=14">Format / layout issues</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_ReportingTypes_ctl01_Link" name="rpt_38746_2_15" onclick="return ReportMe(38746,2,15,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=15&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=15">Wrong section / tags</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_ReportingTypes_ctl02_Link" name="rpt_38746_2_16" onclick="return ReportMe(38746,2,16,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=16&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=16">Wrong type (tip, blog, article)</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_ReportingTypes_ctl03_Link" name="rpt_38746_2_17" onclick="return ReportMe(38746,2,17,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=17&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=17">Missing images/downloads</a>
							</div>
						 
							<div class="report-prompt nowrap">
								
								<a id="ctl00_ReportItem_ReportingTypeHeaders_ctl01_ReportingTypes_ctl04_Link" name="rpt_38746_2_18" onclick="return ReportMe(38746,2,18,&#39;/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=18&amp;ajax=True&#39;,false,&#39;ctl00_ReportItem_Comments&#39;);" href="/script/Content/Report.aspx?obtid=2&amp;obid=38746&amp;obstid=1&amp;ovid=4&amp;rid=18">Images/downloads are offsite</a>
							</div>
						 
			   

			<div class="Undo"></div>
		</div>
	</span>



							   
						</div>

					</div>

				</div>

				
			</div>
			

			
			<div class="container-text">

				<div id="AT" class="text">
					
					
					
					

						
							
			
					<div id="ctl00_confirmError" class="callout small-text" style="padding:10px;margin:20px;"><img style="float:left;margin-right:10px" 
					src="/images/warning_32.png" width="32px" height="32px" /><b>Is your email address OK?</b>
					You are signed up for our newsletters but your email address is either unconfirmed, or has not 
					been reconfirmed in a long time. Please click 
					<a id="ctl00_RequestConfirmLink2" href="/script/Membership/SendConfirmRequest.aspx?rp=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L">here</a> to have a 
					confirmation email sent so we can confirm your email address and start sending you newsletters 
					again. Alternatively, you can 
					<a id="ctl00_SubscribeLink2" href="/script/Membership/Subscribe.aspx?rp=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L">update your subscriptions</a>.</div><form name="aspnetForm" method="post" action="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L" id="aspnetForm" style="margin:0;padding:0">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjExOTQzNjk4Mw9kFgJmD2QWAgIHD2QWCgIBDxYCHgdWaXNpYmxlZ2QCEQ9kFgICAQ9kFgZmDw8WAh4LTmF2aWdhdGVVcmwFMi9zY3JpcHQvQXJ0aWNsZXMvQWRtaW4vRWRpdG9yQ2hvaWNlLmFzcHg/YWlkPTM4NzQ2ZGQCAg8PFgIfAQU4L3NjcmlwdC9Bd2FyZHMvQWRtaW4vQXdhcmRPYmplY3QuYXNweD9vYmlkPTM4NzQ2Jm9idGlkPTJkZAIKDw8WAh8BBS8vc2NyaXB0L0FydGljbGVzL0FkbWluL1F1ZXVlRWRpdC5hc3B4P2FpZD0zODc0NmRkAhMPZBYCAgEPZBYCAgIPFgIeCWlubmVyaHRtbAUBOGQCFQ9kFgICCw9kFggCAQ8WAh8AZxYEAgEPDxYCHwEFdi9zY3JpcHQvTWVtYmVyc2hpcC9TZW5kQ29uZmlybVJlcXVlc3QuYXNweD9ycD0lMmZBcnRpY2xlcyUyZjM4NzQ2JTJmSG93LVRvLU1hbmFnZS1XaW5kb3dzLVNlcnZpY2UtQXBwbGljYXRpb24tb24tb3VyLUxkZAIDDw8WAh8BBW0vc2NyaXB0L01lbWJlcnNoaXAvU3Vic2NyaWJlLmFzcHg/cnA9JTJmQXJ0aWNsZXMlMmYzODc0NiUyZkhvdy1Uby1NYW5hZ2UtV2luZG93cy1TZXJ2aWNlLUFwcGxpY2F0aW9uLW9uLW91ci1MZGQCAg8WAh4GYWN0aW9uBUIvQXJ0aWNsZXMvMzg3NDYvSG93LVRvLU1hbmFnZS1XaW5kb3dzLVNlcnZpY2UtQXBwbGljYXRpb24tb24tb3VyLUwWCgIBDw8WBB8BBTYvc2NyaXB0L0FydGljbGVzL1N1Ym1pc3Npb25XaXphcmQuYXNweD9hdD0xJmFwaWQ9Mzg3NDYfAGdkZAIDD2QWAgIBDxYCHwBoZAIFD2QWAgICD2QWAgIBDxBkZBYAZAILDxYCHgtfIUl0ZW1Db3VudAIBZAIND2QWAgIBDxYCHgRUZXh0BXs8YSBjbGFzcz0iYW5jaG9yTGluayIgaHJlZj0iL0FydGljbGVzLzM4NzQ2L0hvdy1Uby1NYW5hZ2UtV2luZG93cy1TZXJ2aWNlLUFwcGxpY2F0aW9uLW9uLW91ci1MI19hcnRpY2xlVG9wIj5BcnRpY2xlIFRvcDwvYT5kAgoPDxYEHwUFCVBlcm1hbGluax8BBUIvQXJ0aWNsZXMvMzg3NDYvSG93LVRvLU1hbmFnZS1XaW5kb3dzLVNlcnZpY2UtQXBwbGljYXRpb24tb24tb3VyLUxkZAIZDxYCHwUFQUNvcHlyaWdodCAyMDA5IGJ5IE1kLiA8YiBzdHlsZT0iY29sb3I6ICNGRjk5MDAiPiBNPC9iPmFydWZ1enphbWFuZAIXD2QWAgIFDw8WAh8AaGRkZF8B8ynQeRLiIhonaEDh1fEo/WCm" />
</div>

<div>

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWCQLF7aWTAQKi6fqQCgLAlMXDBwLBlMXDBwLClMXDBwLDlMXDBwLElMXDBwLP+++tCwK5upDkCywXoQxFZpK36Z7LWJ4w6ZKk6+ft" />
</div>

						<a id="ctl00_AddAlternative" title="Write a related article about upgrades or translate this into a different language." class="button add-alternative float-right" href="/script/Articles/SubmissionWizard.aspx?at=1&amp;apid=38746">Add your own<br />alternative version</a>

						<!-- Article Text Start -->
						<div id="contentdiv">
						




<ul class="download">
<li><a href="/KB/cs/HowTo_myServiceManager/myServiceManager.zip">Download source - 36.52 KB </a></li>
</ul>

<h2>Table of Contents</h2>

<ul>
<li><a href="#Introduction" target="_self">Introduction</a> </li>

<li><a href="#Background" target="_self">Background</a> </li>

<li><a href="#ServiceType">Types of Services</a> 
<ul>
<li><a href="#Win32OwnProcess" target="_self">Win32OwnProcess</a> </li>

<li><a href="#Win32ShareProcess" target="_self">Win32ShareProcess</a> </li>
</ul>
</li>

<li><a href="#UsingCode" target="_self">Using the Code</a> </li>

<li><a href="#Sample">Sample Example</a> </li>

<li><a href="#Conclusion" target="_self">Conclusion</a> </li>

<li><a href="#History" target="_self">History</a> </li>
</ul>
<img height="396" hspace="0" src="/KB/cs/HowTo_myServiceManager/myServiceManager.png" width="442" align="baseline" border="0" /> 
<div class="Caption">Figure 1: Windows service application controller.</div>

<h2><a name="Introduction">Introduction</a></h2>

<p>Microsoft Windows services, formerly known as NT services, enable you to create long-running executable applications that run in their own Windows sessions. These services can be automatically started when the computer boots, can be paused and restarted, and do not show any user interface. These features make services ideal for use on a server or whenever you need long-running functionality that does not interfere with other users who are working on the same computer. </p>

<h6>Reference - MSDN</h6>

<p>In this article, we are going to create an application to get a list of service applications currently installed with the status and how to control (i.e., we can simultaneously Stop or Start multiple Services) each service application in your local computer.</p>

<h2><a name="Background">Background</a></h2>

<p>Windows service application is often used for various purposes like push pull data transfer, email, system monitor, etc. My concern is how to manage all the customized service applications in a local server / a remote server as well, that’s why I need to create tools where I can get all the status of specified service applications on a local / remote computer.</p>

<h3><a name="ServiceType">Types of Services</a></h3>

<p>There are two types of services you can create in Visual Studio using the .NET Framework. </p>

<ol>
<li><strong><a name="Win32OwnProcess">Win32OwnProcess</a>:</strong> Services that are the only service in a process are assigned the type <code>Win32OwnProcess</code>. </li>

<li><strong><a name="Win32ShareProcess">Win32ShareProcess</a>:</strong> Services that share a process with another service are assigned the type <code>Win32ShareProcess</code>. </li>
</ol>

<p>*<strong>Note</strong>: You can retrieve the service type by querying the <code>ServiceType </code>property. <br />You might occasionally see other service types if you query existing services that were not created in Visual Studio. For more information on these, see the <code>ServiceType</code>.</p>

<h2><a name="UsingCode">Using the Code</a></h2>

<p>Microsoft Visual Studio .NET Framework 2.0 / update version provides the namespace <code>System.ServiceProcess</code> and we are going to use <code>ServiceController </code>class found in the mentioned namespace. This class represents a Windows Service and allows you to connect to a Windows Service, to manipulate the service and get information about the service.</p>

<p>You can download the sample source code to get a complete picture of the program.</p>

<h3><a name="Sample">Sample Example</a></h3>

<pre lang="cs"> <span class="code-keyword">public</span> <span class="code-keyword">partial</span> <span class="code-keyword">class</span> Manager : Form
    {
        <span class="code-comment">//</span><span class="code-comment">string strServiceName = "";
</span>        <span class="code-keyword">public</span> <span class="code-keyword">string</span> strServerName = <span class="code-string">"</span><span class="code-string">Local"</span>;
        <span class="code-keyword">class</span> ServiceInfo
        {
            <span class="code-keyword">private</span> <span class="code-keyword">string</span> strName, strStatus;
            <span class="code-keyword">public</span> ServiceInfo(<span class="code-keyword">string</span> sName, <span class="code-keyword">string</span> sStatus)
            {
                strName = sName;
                strStatus = sStatus;
            }
            <span class="code-keyword">public</span> <span class="code-keyword">string</span> ServiceName
            {
                <span class="code-keyword">get</span> { <span class="code-keyword">return</span> strName; }
            }
            <span class="code-keyword">public</span> <span class="code-keyword">string</span> ServiceStatus
            {
                <span class="code-keyword">get</span> { <span class="code-keyword">return</span> strStatus; }
            }
        }

        <span class="code-keyword">private</span> ArrayList ALWServiceInfo;
        <span class="code-keyword">public</span> Manager()
        {
            InitializeComponent();
            ALWServiceInfo = <span class="code-keyword">new</span> ArrayList();
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> Manager_Load(<span class="code-keyword">object</span> sender, EventArgs e)
        {
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> getWindowsServices()
        {
                ServiceController[] objArrServices;
                <span class="code-keyword">try</span>
                {
                    <span class="code-keyword">if</span> ((<span class="code-keyword">this</span>.comboBoxServerNameOrIPs.Text == <span class="code-string">"</span><span class="code-string">Local"</span>)
                        || <span class="code-keyword">this</span>.comboBoxServerNameOrIPs.Text ==
				System.Environment.MachineName.ToString ()
                        || <span class="code-keyword">this</span>.comboBoxServerNameOrIPs.Text == <span class="code-string">"</span><span class="code-string">127.0.0.1"</span>)
                    {
                        objArrServices = ServiceController.GetServices();
                    }
                    <span class="code-keyword">else</span>
                        objArrServices = ServiceController.GetServices
					(comboBoxServerNameOrIPs.Text);
                    ALWServiceInfo.Clear();
                    <span class="code-keyword">foreach</span> (ServiceController objServiceController <span class="code-keyword">in</span> objArrServices)
                    {
                        ALWServiceInfo.Add(<span class="code-keyword">new</span> ServiceInfo
			(objServiceController.ServiceName,
			objServiceController.Status.ToString()));
                    }
                    dgServices.DataSource = ALWServiceInfo;
                    dgServices.Refresh();
                }
                <span class="code-keyword">catch</span> (Exception ex)
                {
                    MessageBox.Show(<span class="code-string">"</span><span class="code-string">Error Occurred: "</span> + ex.Message);
                }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> buttonConnect_Click(<span class="code-keyword">object</span> sender, EventArgs e)
        {
            <span class="code-keyword">this</span>.getWindowsServices();
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> buttonClose_Click(<span class="code-keyword">object</span> sender, EventArgs e)
        {
            Application.Exit();
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> setCommandButton()
        {
            <span class="code-comment">//</span><span class="code-comment">get the status of the service.
</span>            <span class="code-keyword">string</span> strServerStatus = WSControllerAgent.Status.ToString();
            <span class="code-comment">//</span><span class="code-comment">check the status of the service and enable the
</span>            <span class="code-comment">//</span><span class="code-comment">command buttons accordingly.
</span>            <span class="code-keyword">if</span> (strServerStatus == <span class="code-string">"</span><span class="code-string">Running"</span>)
            {
                <span class="code-comment">//</span><span class="code-comment">check to see if the service can be paused
</span>                <span class="code-keyword">if</span> (WSControllerAgent.CanPauseAndContinue == <span class="code-keyword">true</span>)
                {
                    ButtonPause.Enabled = <span class="code-keyword">true</span>;
                }
                <span class="code-keyword">else</span>
                {
                    ButtonPause.Enabled = <span class="code-keyword">false</span>;
                }
                ButtonStop.Enabled = <span class="code-keyword">true</span>;
                ButtonStart.Enabled = <span class="code-keyword">false</span>;
            }
            <span class="code-keyword">else</span> <span class="code-keyword">if</span> (strServerStatus == <span class="code-string">"</span><span class="code-string">Paused"</span>)
            {
                ButtonStart.Enabled = <span class="code-keyword">true</span>;
                ButtonPause.Enabled = <span class="code-keyword">false</span>;
                ButtonStop.Enabled = <span class="code-keyword">true</span>;
            }
            <span class="code-keyword">else</span> <span class="code-keyword">if</span> (strServerStatus == <span class="code-string">"</span><span class="code-string">Stopped"</span>)
            {
                ButtonStart.Enabled = <span class="code-keyword">true</span>;
                ButtonPause.Enabled = <span class="code-keyword">false</span>;
                ButtonStop.Enabled = <span class="code-keyword">false</span>;
            }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> getSelectedServiceStatus()
        {
            <span class="code-keyword">try</span>
            {
            }
            <span class="code-keyword">catch</span> (Exception ex)
            {
                MessageBox.Show(<span class="code-string">"</span><span class="code-string">Error Occurred: "</span> + ex.Message);
            }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> dgServices_MouseClick(<span class="code-keyword">object</span> sender, MouseEventArgs e)
        {
            <span class="code-keyword">this</span>.onLoadWServices(<span class="code-keyword">this</span>.dgServices.CurrentCell.Value.ToString());
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> onLoadWServices(<span class="code-keyword">string</span> strServiceName)
        {
            <span class="code-keyword">try</span>
            {
                ServiceController[] AvailableServices =
				ServiceController.GetServices(<span class="code-string">"</span><span class="code-string">."</span>);
                <span class="code-keyword">if</span> (strServiceName != <span class="code-string">"</span><span class="code-string">"</span>)
                {
                    <span class="code-keyword">foreach</span> (ServiceController AvailableService <span class="code-keyword">in</span> AvailableServices)
                    {
                        <span class="code-comment">//</span><span class="code-comment">Check the service
</span>                        <span class="code-keyword">if</span> (AvailableService.ServiceName == strServiceName)
                        {
                            <span class="code-keyword">this</span>.WSControllerAgent.ServiceName = strServiceName;
                            <span class="code-keyword">this</span>.setCommandButton();
                            <span class="code-keyword">return</span>;
                        }
                    }
                }
            }
            <span class="code-keyword">catch</span>
            {
                MessageBox.Show(<span class="code-string">"</span><span class="code-string">The Service is not installed on this Machine"</span>,
						<span class="code-string">"</span><span class="code-string">Service is not available"</span>);
                <span class="code-keyword">this</span>.Close();
                Application.Exit();
            }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> ButtonStart_Click(<span class="code-keyword">object</span> sender, EventArgs e)
        {
            <span class="code-comment">//</span><span class="code-comment">check the status of the service
</span>            <span class="code-keyword">if</span> (WSControllerAgent.Status.ToString() == <span class="code-string">"</span><span class="code-string">Paused"</span>)
            {
                WSControllerAgent.Continue();
            }
            <span class="code-keyword">else</span> <span class="code-keyword">if</span> (WSControllerAgent.Status.ToString() == <span class="code-string">"</span><span class="code-string">Stopped"</span>)
            {
                <span class="code-comment">//</span><span class="code-comment">get an array of services this service depends upon, loop through
</span>                <span class="code-comment">//</span><span class="code-comment">the array and prompt the user to start all required services.
</span>                ServiceController[] ParentServices = WSControllerAgent.ServicesDependedOn;
                <span class="code-keyword">try</span>
                {
                    <span class="code-comment">//</span><span class="code-comment">if the length of the array is greater than or equal to 1.
</span>                    <span class="code-keyword">if</span> (ParentServices.Length &gt;= <span class="code-digit">1</span>)
                    {
                        <span class="code-keyword">foreach</span> (ServiceController ParentService <span class="code-keyword">in</span> ParentServices)
                        {
                            <span class="code-comment">//</span><span class="code-comment">make sure the parent service is running or at least paused.
</span>                            <span class="code-keyword">if</span> (ParentService.Status.ToString() != <span class="code-string">"</span><span class="code-string">Running"</span> ||
				ParentService.Status.ToString() != <span class="code-string">"</span><span class="code-string">Paused"</span>)
                            {
                                <span class="code-keyword">if</span> (MessageBox.Show(<span class="code-string">"</span><span class="code-string">This service is required.
				Would you like to also start this service?\n"</span> +
				ParentService.DisplayName, <span class="code-string">"</span><span class="code-string">Required Service"</span>,
				MessageBoxButtons.YesNo).ToString() == <span class="code-string">"</span><span class="code-string">Yes"</span>)
                                {
                                    <span class="code-comment">//</span><span class="code-comment">if the user chooses to start the service
</span>                                    ParentService.Start();
                                    ParentService.WaitForStatus
					(ServiceControllerStatus.Running);
                                }
                                <span class="code-keyword">else</span>
                                {
                                    <span class="code-comment">//</span><span class="code-comment">otherwise just return.
</span>                                    <span class="code-keyword">return</span>;
                                }
                            }
                        }
                    }
                    WSControllerAgent.Start();
                    WSControllerAgent.WaitForStatus
			(System.ServiceProcess.ServiceControllerStatus.Running);
                }
                <span class="code-keyword">catch</span> (Exception ex)
                {
                    MessageBox.Show(<span class="code-string">"</span><span class="code-string">Error Occurred: "</span> + ex.Message.ToString());
                }
                <span class="code-keyword">this</span>.setCommandButton();
            }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> ButtonPause_Click(<span class="code-keyword">object</span> sender, EventArgs e)
        {
            <span class="code-comment">//</span><span class="code-comment">check to see if the service can be paused and continue
</span>            <span class="code-keyword">if</span> (WSControllerAgent.CanPauseAndContinue == <span class="code-keyword">true</span>)
            {
                <span class="code-comment">//</span><span class="code-comment">check the status of the service
</span>                <span class="code-keyword">if</span> (WSControllerAgent.Status.ToString() == <span class="code-string">"</span><span class="code-string">Running"</span>)
                {
                    WSControllerAgent.Pause();
                }
                WSControllerAgent.WaitForStatus
			(System.ServiceProcess.ServiceControllerStatus.Paused);
                <span class="code-keyword">this</span>.setCommandButton();
            }
        }
        <span class="code-keyword">private</span> <span class="code-keyword">void</span> ButtonStop_Click(<span class="code-keyword">object</span> sender, EventArgs e)
        {
            <span class="code-comment">//</span><span class="code-comment">check to see if the service can be stopped.
</span>            <span class="code-keyword">if</span> (WSControllerAgent.CanStop == <span class="code-keyword">true</span>)
            {
                <span class="code-comment">//</span><span class="code-comment">get an array of dependent services, loop through the array and
</span>                <span class="code-comment">//</span><span class="code-comment">prompt the user to stop all dependent services.
</span>                ServiceController[] DependentServices =
				WSControllerAgent.DependentServices;
                <span class="code-comment">//</span><span class="code-comment">if the length of the array is greater than or equal to 1.
</span>                <span class="code-keyword">if</span> (DependentServices.Length &gt;= <span class="code-digit">1</span>)
                {
                    <span class="code-keyword">foreach</span> (ServiceController DependentService <span class="code-keyword">in</span> DependentServices)
                    {
                        <span class="code-comment">//</span><span class="code-comment">make sure the dependent service is not already stopped.
</span>                        <span class="code-keyword">if</span> (DependentService.Status.ToString() != <span class="code-string">"</span><span class="code-string">Stopped"</span>)
                        {
                            <span class="code-keyword">if</span> (MessageBox.Show(<span class="code-string">"</span><span class="code-string">Would you like to also
					stop this dependent service?\n"</span>
                                + DependentService.DisplayName
                                , <span class="code-string">"</span><span class="code-string">Dependent Service"</span>
                                , MessageBoxButtons.YesNo).ToString() == <span class="code-string">"</span><span class="code-string">Yes"</span>)
                            {
                                <span class="code-comment">//</span><span class="code-comment"> not checking at this point whether the
</span>                                <span class="code-comment">//</span><span class="code-comment"> dependent service can be stopped.
</span>                                <span class="code-comment">//</span><span class="code-comment"> developer may want to include this check
</span>                                <span class="code-comment">//</span><span class="code-comment"> to avoid exception.
</span>                                DependentService.Stop();
                                DependentService.WaitForStatus
					(ServiceControllerStatus.Stopped);
                            }
                            <span class="code-keyword">else</span>
                            {
                                <span class="code-keyword">return</span>;
                            }
                        }
                    }
                }
                <span class="code-comment">//</span><span class="code-comment">check the status of the service
</span>                <span class="code-keyword">if</span> (WSControllerAgent.Status.ToString() ==
		<span class="code-string">"</span><span class="code-string">Running"</span> || WSControllerAgent.Status.ToString() == <span class="code-string">"</span><span class="code-string">Paused"</span>)
                {
                    WSControllerAgent.Stop();
                }
                WSControllerAgent.WaitForStatus
			(System.ServiceProcess.ServiceControllerStatus.Stopped);
                <span class="code-keyword">this</span>.setCommandButton();
            }
        }
     }</pre>

<h2><a name="Conclusion">Conclusion </a></h2>

<p>I hope it might be helpful to you. Enjoy!</p>

<h2><a name="History">History</a></h2>

<ul>
<li>5<sup>th</sup> August 2009: Initial post </li>
</ul>




						</div>
						<!-- Article Text End -->

						
						
						<h2>License</h2>
						<div id="LicenseTerms"><p>This article, along with any associated source code and files, is licensed under <a href="http://www.codeproject.com/info/cpol10.aspx" rel="license">The Code Project Open License (CPOL)</a></p></div>
						

						
						<h2 id="ctl00_AboutHeading">About the Author</h2>

						<div class="float-right">
						<div class="lqm_ad" lqm_publisher="lqm.codeproject.site"  lqm_zone="ros" lqm_format="300x250" lqm_loadOnView='true'  lqm_tags='VS2005, .NET3.0, .NET3.5, VS2008, C#, .NET, Visual-Studio, Beginner, Intermediate, .NET4,rating4.5'></div>
						</div>

						
						
<table cellpadding="0" cellspacing="5" border="0">
<tr valign="top">
<td id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhotoTable" valign="top" style="width:155px;">
	<b><a id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberProfileLink" href="/Members/Md-Marufuzzaman">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></b><br /><br />
	<center><img id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhoto" src="/script/Membership/ProfileImages/{bbbc6447-eeea-454c-b2a6-d76732ec0dc5}.gif" style="border-width:0px;" /></center>

	<div class="small-text">
		<span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberJobTitle">Architect</span><br />
		<span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberCompany"></span><br />
		<span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberLocation"><img src="/script/Geo/Images/BD.gif" alt="Bangladesh" width="16px" height="11px" /> Bangladesh</span><br />
		<br />
		<span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberType">Member</span><br />
		<br /><a class="small-text" href="http://www.twitter.com/Md_Marufuzzaman"> <img style="vertical-align:middle;border:0;" src="http://twitter-badges.s3.amazonaws.com/t_mini-b.png" alt="Follow on Twitter"/> Follow on Twitter</a>
		<br />

		
	</div>
</td>

<td>
	<br />	
</td>
</tr>
</table><br />
						
						

						<div class="clearfix"></div>

						
						<div id="ctl00_RateArticleRow" class="clearfix voting-bar">
						<div class="float-left" style="padding-top:8px"><a class="anchorLink" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L#_articleTop">Article Top</a></div>
						<div class="float-right"><a id="_rating" name="_rating">&nbsp;</a></div> 
						<div class="float-right align-right">
							<div id="ctl00_RateArticle_RateItemWrapper" class="container-rating small-text" name="RateItem_38746">

	<table width="100%" cellpadding="0" cellspacing="0" class="small-text">
	<tr>
		<td id="ctl00_RateArticle_VoteResultDiv" nowrap="nowrap" align="right">
			<span class="voteRes"></span>
			<img class="loaderImg" width="16px" alt="loading..." height="16px" 
				src="/Images/animated_loading_blue.gif" style="display:none;" /> 
		</td>

	
		<td class="voteTbl" style="white-space:nowrap" align="right">
			<table class="small-text">
			<tr>
				
				<td id="ctl00_RateArticle_RateText" class="rating-prompt">
					Rate this:
				</td>

				<td id="ctl00_RateArticle_StartForm" align="right" nowrap="nowrap">
					<i>&nbsp;&nbsp;Poor</i>
				</td>

				<td id="ctl00_RateArticle_VoteFormDiv" class="nowrap">
					

					<span id="ctl00_RateArticle_RB" class="tooltip ajaxHist radio voting">
						<span id="ctl00_RateArticle_VoteRBL"><input id="ctl00_RateArticle_VoteRBL_0" type="radio" name="ctl00$RateArticle$VoteRBL" value="1" onclick="ChkRtctl00_RateArticle(1, 38746);
$(&#39;#ctl00_RateArticle_RCD&#39;).show();
;" /><input id="ctl00_RateArticle_VoteRBL_1" type="radio" name="ctl00$RateArticle$VoteRBL" value="2" onclick="ChkRtctl00_RateArticle(2, 38746);
$(&#39;#ctl00_RateArticle_RCD&#39;).show();
;" /><input id="ctl00_RateArticle_VoteRBL_2" type="radio" name="ctl00$RateArticle$VoteRBL" value="3" onclick="ChkRtctl00_RateArticle(3, 38746);
$(&#39;#ctl00_RateArticle_RCD&#39;).show();
;" /><input id="ctl00_RateArticle_VoteRBL_3" type="radio" name="ctl00$RateArticle$VoteRBL" value="4" onclick="ChkRtctl00_RateArticle(4, 38746);
$(&#39;#ctl00_RateArticle_RCD&#39;).show();
;" /><input id="ctl00_RateArticle_VoteRBL_4" type="radio" name="ctl00$RateArticle$VoteRBL" value="5" onclick="ChkRtctl00_RateArticle(5, 38746);
$(&#39;#ctl00_RateArticle_RCD&#39;).show();
;" /></span> 

						
					</span>

				</td>

				<td id="ctl00_RateArticle_EndForm" align="left">
					<i>Excellent</i>
				</td>

				<td>	
					<input type="submit" name="ctl00$RateArticle$SubmitRateBtn" value="Vote" onclick="return PostBack_ctl00_RateArticle_RateItemWrapper();" id="ctl00_RateArticle_SubmitRateBtn" class="button" />
				</td>
			</tr>
			</table>
			<span id="ctl00_RateArticle_ErrorMessage" class="error"></span>
		</td>
	</tr>
	</table>
	<div class="hover-container">
		<div id="ctl00_RateArticle_RCD" class="rating-comment align-left float-right">
			Add a reason or comment to your vote: <a href="#" id="clear-rate_ctl00_RateArticle_RCD" 
				title="close">x</a><br />
			<textarea class="RateComment" rows="5" cols="60" style="width:98%;"></textarea>
			<span id="ctl00_RateArticle_CommentReq" class="subdue">Votes of 3 or less require a comment</span>
		</div>
	</div>
</div>
						</div>
						</div>
						

					</form>

					
					<div style="margin:auto;width:728px;height:90px;margin-top:10px">		  
						<div class="lqm_ad" lqm_publisher="lqm.codeproject.site"  lqm_zone="bottom" lqm_format="728x90" lqm_loadOnView='true'  lqm_tags='VS2005, .NET3.0, .NET3.5, VS2008, C#, .NET, Visual-Studio, Beginner, Intermediate, .NET4,pos_bottom'></div>
					</div>
					

					
					
					<h2>Comments and Discussions</h2>
					<a name="_comments" id="_comments">&nbsp;</a><div id="_MessageBoardctl00_MessageBoard" onclick="return SwitchMessage(event, null)">
	<table id="ForumTable" class="box forum" cellpadding="0" cellspacing="0">
		<tr>
			<td><table width="100%" border="0" cellpadding="3px" cellspacing="0">
				<tr class="forum-header1">
					<td colspan="2" style="white-space:nowrap;"><div class="container">
						<div class="button-newmsg float-left" onclick="FireNew(this)">
							<img src="http://s.codeproject.com/script/Forums/Images/forum_newmsg.gif" alt="new" width="16px" height="16px" border="0" align="top" /> <a href="/script/Forums/Edit.aspx?fid=1544863&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L" name="Frm_HoverNL" title="Add a Add a Comment or Question" target="_top"><b>Add a Comment or Question</b></a>
						</div>&nbsp;<div class="float-right">
							<form action="/Search.aspx?fid=0" method="get" class="tight">
								<input type="hidden" name="fid" value="1544863" /><b>Search this forum </b><input type="text" class="Frm_Input" name="qf" style="width:200px;" />&nbsp;<input type="submit" value="Go" class="button" />
							</form>
						</div>
					</div></td><tr class="forum-header2">
						<td style="white-space:nowrap;">&nbsp;<a href="/KB/FAQs/MessageBoardsFAQ.aspx"><img src="http://s.codeproject.com/script/Forums/Images/msg_question.gif" title="FAQ" alt="FAQ" style="border-width:0;width:16px;height:16px;vertical-align:middle;" /></a></td><td style="width:100%;"><div style="text-align:right;">
							<form action="/script/Forums/SetOptions.aspx?floc=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L&amp;fid=1544863" method="get" style="margin:0;padding:0;">
								<input type="hidden" name="fid" value="1544863" /><input type="hidden" name="currentQS" value="?floc=%2fArticles%2f38746%2fHow-To-Manage-Windows-Service-Application-on-our-L&amp;fid=1544863" /><input type="hidden" name="floc" value="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L" /><input type="checkbox" name="prof" id="prof" style="vertical-align:middle;" /><label for="prof">Profile popups</label>&nbsp;&nbsp;&nbsp;&nbsp;Noise<select size="1" class="Frm_DropDown" name="noise">
									<option value="1">Very High</option><option value="2">High</option><option selected value="3">Medium</option><option value="4">Low</option><option value="5">Very Low</option>
								</select>&nbsp;&nbsp;Layout<select size="1" class="Frm_DropDown" name="view">
									<option selected value="Quick">Normal</option><option value="Topic">Expand Posts only</option><option value="Expanded">Expand Posts & Replies</option><option value="Thread">Thread View</option><option value="Normal">No Javascript</option><option value="Preview">No JS + Preview</option>
								</select>&nbsp;&nbsp;Per page<select size="1" class="Frm_DropDown" name="mpp">
									<option value="10">10</option><option selected value="25">25</option><option value="50">50</option>
								</select>&nbsp;&nbsp;&nbsp;<input type="submit" value="Update" name="SetOpt" class="button" />
							</form>
						</div></td>
					</tr>
				</tr>
			</table></td><tr>
				<td><a name="xx0xx"></a><table border="0" cellpadding="2px" cellspacing="0" width="100%">
					<tr class="forum-navbar">
						<td>&nbsp;</td><td style="text-align:right;width:50%;"> <a href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863">Refresh</a></td><td class="nav-link" style="text-align:right;white-space:nowrap;"><span class="subdue">First</span> <span class="subdue">Prev</span> <span class="subdue">Next</span></td>
					</tr>
				</table></td>
			</tr><tr>
				<td><table border="0" cellpadding="0" cellspacing="0" width="100%" class="fixed-layout blank-background">
					<tr>
						<td><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="5px" alt="" /></td>
					</tr><tr class="MsgHd Rt HdUnSel " id="F4052842_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="16px" class="Frm_MsgIndent"><a name="xx4052842xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_question.gif" alt="Question" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4052842" parent="0" thread="4052842" href="/Messages/4052842/thank-you.aspx">thank you</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-member-16.gif" title="member" alt="member" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=8094517">computermorabbi@yahoo.com</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">15:19 14 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4052842_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:16px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="16px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">understand easily.<br />
thank you very very much.<br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052842&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052842&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=e" title="Email">Email</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052842" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4052842/thank-you.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4052842&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4052842&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4052842" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(8094517,4052842,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd HdUnSel " id="F4053086_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="34px" class="Frm_MsgIndent"><a name="xx4053086xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_answer.gif" alt="Answer" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4053086" parent="4052842" thread="4052842" href="/Messages/4053086/Re-thank-you.aspx">Re: thank you</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-MVP-16.gif" title="mvp" alt="mvp" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=1186309">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">5:52 15 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4053086_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:34px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="34px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">You are always welcome <img src="/script/Forums/Images/smiley_smile.gif" align="top" alt="Smile | :)" /> <br />
<div class="signature">Thanks<br />
Md. <b style="color: #FF9900"> M</b>arufuzzaman<br />
<hr></hr><br />
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.</div><br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4053086&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052842" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4053086/Re-thank-you.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4053086&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4053086&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4053086" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(1186309,4053086,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="root msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd Rt HdUnSel " id="F4052479_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="16px" class="Frm_MsgIndent"><a name="xx4052479xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_question.gif" alt="Question" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4052479" parent="0" thread="4052479" href="/Messages/4052479/Exception-Details.aspx">Exception Details</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-member-16.gif" title="member" alt="member" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=8094517">computermorabbi@yahoo.com</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">9:51 14 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4052479_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:16px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="16px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">hi,my operating system is 7 32bit<br />
for example my sql service name is:MSSQL$SQLEXPRESS<br />
Exception is:Cannot open MSSQL$SQLEXPRESS service on computer '.'.<br />
thanks a lot.<br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052479&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052479&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=e" title="Email">Email</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052479" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4052479/Exception-Details.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4052479&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4052479&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4052479" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(8094517,4052479,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd HdUnSel " id="F4052502_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="34px" class="Frm_MsgIndent"><a name="xx4052502xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_answer.gif" alt="Answer" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4052502" parent="4052479" thread="4052479" href="/Messages/4052502/Re-Exception-Details.aspx">Re: Exception Details</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-MVP-16.gif" title="mvp" alt="mvp" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=1186309">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">10:01 14 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4052502_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:34px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="34px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">Hi,<br />
Well, I hope you know there is an administrative per-village, try to run as administrator.<br />
<div class="signature">Thanks<br />
Md. <b style="color: #FF9900"> M</b>arufuzzaman<br />
<hr></hr><br />
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.</div><br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052502&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052479" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4052502/Re-Exception-Details.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4052502&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4052502&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4052502" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(1186309,4052502,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="root msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd Rt HdUnSel " id="F4052249_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="16px" class="Frm_MsgIndent"><a name="xx4052249xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_question.gif" alt="Question" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4052249" parent="0" thread="4052249" href="/Messages/4052249/please-help-me.aspx">please help me.</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-member-16.gif" title="member" alt="member" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=8094517">computermorabbi@yahoo.com</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">6:54 14 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4052249_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:16px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="16px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">when i use this program,if i want to start or stop the services,the program trow a exception:the exception is:cannot open this service on this computer.<br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052249&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052249&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=e" title="Email">Email</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052249" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4052249/please-help-me.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4052249&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4052249&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4052249" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(8094517,4052249,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd HdUnSel " id="F4052276_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="34px" class="Frm_MsgIndent"><a name="xx4052276xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_answer.gif" alt="Answer" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4052276" parent="4052249" thread="4052249" href="/Messages/4052276/Re-please-help-me.aspx">Re: please help me.</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-MVP-16.gif" title="mvp" alt="mvp" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=1186309">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">7:17 14 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4052276_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:34px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="34px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">Hi:<br />
Could you copy & pest the error detail.<br />
<div class="signature">Thanks<br />
Md. <b style="color: #FF9900"> M</b>arufuzzaman<br />
<hr></hr><br />
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.</div><br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4052276&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=4052249" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4052276/Re-please-help-me.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4052276&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4052276&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4052276" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(1186309,4052276,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="root msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd HiVote Rt HdUnSel " id="F3708638_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="16px" class="Frm_MsgIndent"><a name="xx3708638xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_general.gif" alt="General" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="3708638" parent="0" thread="3708638" href="/Messages/3708638/My-vote-of-5.aspx">My vote of 5</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-member-16.gif" title="member" alt="member" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=6278166">khalidC#</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">0:08 23 Dec '10 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F3708638_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:16px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="16px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">This is excellent..and Helpful<br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=3708638&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=3708638" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/3708638/My-vote-of-5.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=3708638&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=3708638&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF3708638" style="white-space:nowrap;">5.00/5 (1 vote) <script type="text/javascript">
													MsgVFrm(6278166,3708638,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr class="quick">
						<td class="msg-divide"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="1px" alt="" /></td>
					</tr><tr class="MsgHd HdUnSel " id="F4044567_h0">
						<td width="100%"><table class="quickHd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr class="hover-row">
								<td width="34px" class="Frm_MsgIndent"><a name="xx4044567xx"></a><img height="16px" width="16px" align="top" src="/script/Forums/Images/msg_general.gif" alt="General" /></td><td class="Frm_MsgSubject hover-container"><a class="message-link" name="4044567" parent="3708638" thread="3708638" href="/Messages/4044567/Re-My-vote-of-5.aspx">Re: My vote of 5</a> <a onclick="return Pin(this);" href="#" title="Click to pin message"><img src="http://s.codeproject.com/script/Forums/Images/pin.gif" border="0" align="top" alt="Pin" width="13px" height="12px" /></a></td><td class="Frm_MsgIcon"><img border="0" src="http://s.codeproject.com/App_Themes/Std/Img/icn-MVP-16.gif" title="mvp" alt="mvp" height="16px" /></td><td class="Frm_MsgAuthor"><a href="/script/Membership/View.aspx?mid=1186309">Md. <b style="color: #FF9900"> M</b>arufuzzaman</a></td><td class="Frm_MsgDate" style="vertical-align:top;white-space:nowrap;">4:13 6 Oct '11 &nbsp;</td>
							</tr>
						</table></td>
					</tr><tr id="F4044567_h1" style="display:none;">
						<td width="100%"><table class="quickBd" border="0" cellpadding="0" cellspacing="0" width="100%">
							<tr>
								<td class="Frm_MsgIndent" style="width:34px;"><img src="http://s.codeproject.com/script/Forums/Images/t.gif" height="1px" width="34px" alt="" /></td><td class="MsgBd BdSel "><table border="0" cellpadding="0" cellspacing="5px" width="100%">
									<tr>
										<td><table border="0" cellpadding="0" cellspacing="0" width="100%">
											<tr>
												<td colspan="2">I am so happy to know that.. Thanks <img src="/script/Forums/Images/smiley_smile.gif" align="top" alt="Smile | :)" /> <br />
<div class="signature">Thanks<br />
Md. <b style="color: #FF9900"> M</b>arufuzzaman<br />
<hr></hr><br />
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.</div><br /></td>
											</tr><tr style="vertical-align:middle;">
												<td class="msg-footer"><a class="button-newmsg" href="/script/Forums/Edit.aspx?fid=1544863&amp;select=4044567&amp;floc=/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L&amp;action=r" title="Reply">Reply</a>·<a class="toolbar" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;tid=3708638" title="View&nbsp;Thread">View&nbsp;Thread</a>·<a class="toolbar" href="/Messages/4044567/Re-My-vote-of-5.aspx" title="Get permanent link">Permalink</a>·<a class="toolbar" href="/script/Bookmarks/Add.aspx?obid=4044567&amp;obtid=3&amp;action=AddBookmark&amp;bio=false" title="Bookmark this post" onclick="return bookmarkMe(0,0,'/script/Bookmarks/Ajax/Add.aspx?obid=4044567&obtid=3&action=AddBookmark&bio=false',false, this, this);">Bookmark</a></td><td class="msg-footer" style="text-align:right;"><span id="MVF4044567" style="white-space:nowrap;"><script type="text/javascript">
													MsgVFrm(1186309,4044567,false,"","","");
												</script></span></td>
											</tr>
										</table></td>
									</tr>
								</table></td>
							</tr>
						</table></td>
					</tr><tr>
						<td><img src="http://s.codeproject.com/script/Forums/Images/t.gif" border="0" width="1px" height="5px" alt="" /></td>
					</tr>
				</table></td>
			</tr><tr>
				<td><table width="100%" cellpadding="2px" cellspacing="0">
					<tr class="forum-footer">
						<td>Last Visit: 20:14 28 May '12  &nbsp; &nbsp; Last Update: 16:18 28 May '12 </td><td class="nav-link" style="text-align:right;white-space:nowrap;"><input id="_mbnUrl" type="hidden" value="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?fid=1544863&amp;fr=9" /><b>1</b></td>
					</tr>
				</table></td>
			</tr>
		</tr>
	</table>
</div><p class="small-text"><img align="top" src="/script/Forums/Images/msg_general.gif" width="16px" height="16px" alt="General" /> General &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_news.gif" width="16px" height="16px" alt="News" /> News &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_idea.gif" width="16px" height="16px" alt="Suggestion" /> Suggestion &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_question.gif" width="16px" height="16px" alt="Question" /> Question &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_bug.gif" width="16px" height="16px" alt="Bug" /> Bug &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_answer.gif" width="16px" height="16px" alt="Answer" /> Answer &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_joke.gif" width="16px" height="16px" alt="Joke" /> Joke &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_rant.gif" width="16px" height="16px" alt="Rant" /> Rant &nbsp;&nbsp; <img align="top" src="/script/Forums/Images/msg_admin.gif" width="16px" height="16px" alt="Admin" /> Admin &nbsp;&nbsp; </p><p class="small-text">Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.</p>

					
					<div class="theme1-background" style="height:2px"></div>

					<div class="extended tiny-text">
						<div class="row">
							<div class="float-left">
								<a id="ctl00_PermaLink" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L">Permalink</a> | 
								<a id="ctl00_AdvertiseLink" href="http://lakequincy.com/">Advertise </a> |
								<a id="ctl00_PrivacyLink" href="/info/privacy.aspx">Privacy</a> |
								<a id="ctl00_Mobile" rel="nofollow" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?display=Mobile">Mobile</a>
								<br />
								
								Web02 |
								2.5.120528.1 |
								Last Updated 4 Aug 2009								
							</div>
							<div class="float-right align-right">
								Article Copyright 2009 by Md. <b style="color: #FF9900"> M</b>arufuzzaman<br />Everything else
								Copyright &copy; <a href="mailto:webmaster@codeproject.com">CodeProject</a>, 1999-2012 <br />
								<a id="ctl00_TermsOfUseLink" href="/info/TermsOfUse.aspx">Terms of Use</a>
							</div>

							


<div class="page-width">
Layout: <a id="ctl00_PageWidth_FixedT" title="Fixed width layout" rel="nofollow" class=" active" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?PageFlow=FixedWidth">fixed</a>
|
<a id="ctl00_PageWidth_FluidT" title="Fluid layout" rel="nofollow" href="/Articles/38746/How-To-Manage-Windows-Service-Application-on-our-L?PageFlow=Fluid">fluid</a>
</div>



						</div>
					</div>
					

				<br clear="all" />
		
				
				</div>

				<div id="ctl00_ContentSide" class="text-sidebar">
					

					

					

					
<div class="announce">

<div class="announce-content">

<div>Hot News: <a id="ctl00_News_News_ctl01_Link" href="http://www.neowin.net/news/windows-8-boots-too-quickly-first-world-os-problem">Windows 8 boots too quickly, first world OS problem</a></div>

The Code Project Insider. <a id="ctl00_News_News_ctl02_Subscribe" href="/Feature/Insider/">Free each morning.</a>
</div>
</div>

						
					<div style="width:160px;margin: 10px 0;">
						<div class="lqm_ad" lqm_publisher="lqm.codeproject.site"  lqm_zone="ros" lqm_format="160x600" lqm_tags='VS2005, .NET3.0, .NET3.5, VS2008, C#, .NET, Visual-Studio, Beginner, Intermediate, .NET4,rating4.5'></div>
					</div>

					
	<div class="announce">
	<div id="ctl00_RelatedArticles_RelatedResults_ctl00_header" class="announce-header">Related Articles</div>
	<div class="announce-content">	
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl01_Link" class="title" href="/KB/cs/ServiceController.aspx">A ServiceController Class that Contains the Path to the Executable</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl02_Link" class="title" href="/KB/system/Svc_Controller_in_C_Sharp.aspx">Using the ServiceController in C# to stop and start a service</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl03_Link" class="title" href="/KB/system/extendservicecontroller.aspx">Extend ServiceController class to change the StartupType of Windows Services</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl04_Link" class="title" href="/Tips/243290/Manage-All-Windows-Services.aspx">Manage All Windows Services</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl06_Link" class="title" href="/KB/cs/svcmgr.aspx">Command Line Windows Services Manager</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl07_Link" class="title" href="/KB/cs/Service_Monitor_Central.aspx">Monitor and Manage Services on Remote Machines</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl08_Link" class="title" href="/KB/cs/service_controller.aspx">Service Controller</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl09_Link" class="title" href="/KB/cs/winservicemanage.aspx">Windows Service Management</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl10_Link" class="title" href="/KB/cs/csservicecompcp.aspx">Windows Services information component</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl11_Link" class="title" href="/KB/webservices/Web_Method_To_Restart_NT.aspx">Create a Web Service Method to Manage a NT Service</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl12_Link" class="title" href="/KB/webservices/Web_Method_To_Get_NT_Serv.aspx">Create A Web Service Method to Get NT Service Information</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl13_Link" class="title" href="/KB/cs/Service_Manager.aspx">Service Manager</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl14_Link" class="title" href="/KB/system/ServiceDebug.aspx">How to Start and Debug a Windows Service with Visual Studio 2008</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl15_Link" class="title" href="/KB/system/Services.aspx">Using .NET 2.0 to Create a Windows Service</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl16_Link" class="title" href="/KB/install/csharpsvclesson2.aspx">Creating a C# Service Step-by-Step Lesson II</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl17_Link" class="title" href="/KB/IP/Chat_Application.aspx">Chat Application with Windows Services, .NET Remoting in C#</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl18_Link" class="title" href="/KB/system/Download_Limiter.aspx">Internet Download Limiter</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl19_Link" class="title" href="/KB/IP/HostingMultipleServices.aspx">Hosting multiple services in separate AppDomains</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl20_Link" class="title" href="/KB/dotnet/netdiagnostics3.aspx">.NET Diagnostics - III, Enumerate System Services and Dependencies Using C#</a>
		
	</div>
	
	<div class="container-related-item">
		<a id="ctl00_RelatedArticles_RelatedResults_ctl21_Link" class="title" href="/KB/cs/hoytsoft_servicebase.aspx">Self installing .NET service using the Win32 API</a>
		
	</div>
	
	</div>
	</div>
	


					

				</div>

			</div>
			

		</div>
		

	</div>
</div>


<div style="display:none;" id="lqm_AdTable">
	
</div>

<script type="text/javascript" language="Javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script><script type='text/javascript'>//<![CDATA[
if (typeof jQuery == 'undefined') {
    document.write(unescape("%3Cscript src='/script/JS/jquery-1.6.2.min.js' type='text/javascript' %3E%3C/script%3E"));
}//]]></script>
<script type="text/javascript" language="Javascript" src="http://s.codeproject.com/script/Articles/JS/article.min.js?dt=2.5.120528.1"></script>
<script type="text/javascript" language="Javascript" src="http://s.codeproject.com/script/JS/navbar.min.js?dt=2.5.120528.1"></script>
<script type="text/javascript" language="Javascript" src="/Script/JS/m.min.js?dt=2.5.120528.1"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
function markAllText(){
 markTextInElement('ServiceControl','contentdiv');
}
$(function(){markAllText()});
var socialLinks = new social();
socialLinks.PlaceholderId="ATD";socialLinks.ObjectId=38746;
socialLinks.ObjectTypeId=2;
socialLinks.addtoMethod=1;
socialLinks.Horizontal=false;
socialLinks.Showname=true;
socialLinks.setupLinks("socialLinks", escape(document.location.href),escape(document.title), 100, 0, "small-text Bold", "AddTo");
socialLinks.setupMenu();
$(document).ready(function() {   $('.alert-bar').slideDown('fast');   $('.alert-bar a.close-notify').click(function() {      $('.alert-bar').slideUp('fast');        return false;    });});
if($.LqmAds)$.LqmAds();
var oSrchFlt = false, oSrchBox=false,srchBoxFoc=false;
$(document).ready(function() {
 if(InitWatermark)InitWatermark('sb_tb', 'Search site');
 var sbar = $('#sb_tb'); 
 var sfilter = $('#SearchFilter');
 if (sbar && sfilter) {
  sfilter.removeClass('popup'); sfilter.hide();
  sbar.blur(function() { if (!oSrchFlt)sfilter.hide();srchBoxFoc=false; });
  sbar.focus(function() { oSrchFlt=false;srchBoxFoc=true;sfilter.show(); });
  sbar.mouseleave(function() { oSrchBox=false; });
  sbar.mouseover(function() { oSrchBox=true; });
  sfilter.mouseleave(function() { oSrchFlt=false; if (!srchBoxFoc&&!oSrchBox)sfilter.hide();});
  sfilter.mouseover(function() { oSrchFlt=true; });
 }
});
$(document).ready(function() { anchorAnimate(); });
var reportingMemberId = 8126139;
$("#ctl00_RateArticle_RateItemWrapper").removeClass("container-rating");$('#clear-rate_ctl00_RateArticle_RCD').click(function () { $('#ctl00_RateArticle_RCD').hide(); return false;});
function PostBack_ctl00_RateArticle_RateItemWrapper() {
  return rateItem(38746,2,1,true,true,3);
}
function ChkRtctl00_RateArticle(val, objId) {if (val<=3||true) {
$('div[name=RateItem_' + objId + '] .rating-comment').css("display","");}
else $('div[name=RateItem_' + objId + '] .rating-comment').css("display","none");}


//]]>
</script>

</body>
</html>
